<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: green;
            animation-name: change ;
            /* 给动画规定的时间 */
            animation-duration: 1s;
            /* 过渡曲线效果 */
            animation-timing-function: linear;
            /* 延迟 */
            animation-delay: 2s;
            /* 重复执行 默认是1次*/
            animation-iteration-count: 5;
        }

        .box2{
            width: 100px;
            height: 100px;
            background-color: blue;
            animation: move 2s linear infinite;
            margin-top:20px;
        }

        @keyframes change {

            /* 用from to 表示从0%到100%
               也可以直接用百分比的方式*/

            /*from {*/
            /*    background-color: blue;*/
            /*}*/
            /*to {*/
            /*    background-color: bisque;*/
            /*}*/

            0%{
                background-color: blue;
            }

            25%{
                background-color: green;
            }

            75%{
                background-color: sandybrown;
            }

            100%{
                background-color: yellow;
            }
        }

        @keyframes move {
            from{
                transform: rotate(0deg);
            }
            to{
                transform: rotate(360deg);
            }
        }
    </style>
</head>
<body>
<div class="box"></div>
<div class="box2"></div>
</body>
</html>
